Skip to content

Fixing a bug#1

Open
myeu wants to merge 2 commits into
zjpjack:masterfrom
myeu:master
Open

Fixing a bug#1
myeu wants to merge 2 commits into
zjpjack:masterfrom
myeu:master

Conversation

@myeu

@myeu myeu commented Nov 29, 2014

Copy link
Copy Markdown

In the original code, a node could have its cost set at two levels, with the higher cost level setting the final cost. I saw this happening in my test data. Below is an excerpt from my debugging.

The visited array is supposed to make sure the cost is set only once. It doesn't control whether it's own edges are processed. Therefore, the visited boolean should be set at the same time as cost. Level will be true and on the next iteration that node will be processed to get its edges.

The change in the bfs.cu code is necessary because the starting node doesn't need to get its cost set in the kernel. So visited should be set to true at the same time as the cost, outside the kernel.

In my test data, Node 15152 is connected to the starting node, it should have cost = 2
Iteration Num: node id, visited, cost
1: 15152, 0, -1
2: 15152, 0, 2
3: 15152, 1, 4

Cost is set at Iteration 2, but visited is still false until the next iteration. Since it was false for a time, another node got to it and set its cost again, to 4.

I found your code to be extremely helpful. I wanted to be helpful in return by letting you know about the bug I found.

Hi,

Could you please send me the data file you use?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant